package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintStream;

/**
 * Created by varoske on 3/4/14.
 */
public class Biblioteca {
    private PrintStream printStream;
    private Printer printer;
    private MenuChooser menuChooser;
    private BufferedReader bufferedReader;


    public Biblioteca(PrintStream printStream, Printer printer, MenuChooser menuChooser,
                      BufferedReader bufferedReader) {
        this.printStream= printStream;
        this.printer= printer;
        this.menuChooser= menuChooser;
        this.bufferedReader = bufferedReader;
    }

    public static void main(String[] args) {
        Biblioteca biblioteca= new Biblioteca(new PrintStream(System.out), new Printer(), new MenuChooser(),
                new BufferedReader(new InputStreamReader(System.in)));
        biblioteca.go();

    }

    public void go() {
        printer.greet(printStream);
        printer.printBookList(printStream);


        menuChooser.listMenuOptions(printStream);
        String selectedOption= menuChooser.parseInput(bufferedReader);
        printStream.println(selectedOption);
    }

}
